package com.common.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 *   统一响应类
 * </p>
 * @author 34448
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RestResult<T> {

    /**
     * 业务返回码
     */
    @ApiModelProperty(value = "业务返回码")
    private String code;

    /**
     * 业务提示信息
     */
    @ApiModelProperty(value = "业务提示信息")
    private String msg;

    /**
     * 业务数据
     */
    @ApiModelProperty(value = "业务数据")
    private T data;

    public RestResult(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}